<!--
 * @Author: zheguo 3188606474@qq.com
 * @Date: 2024-04-19 23:00:28
 * @LastEditors: zheguo 3188606474@qq.com
 * @LastEditTime: 2024-04-24 11:24:13
 * @FilePath: \projectOne\myapp\src\views\Allin.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
    <div class="register_content">
        <div class="content_img">
            <img src="https://cdn.web-global.fds.api.mi-img.com/mcfe--mi-account/static/static/media/banner.92c693b4..jpg"
                alt="" style="width: 100%;height: 100%;">
        </div>

        <div class="content_form">
            <div class="content_navbar">
                <div class="navbar_one">
                    <img src="https://cdn.cnbj1.fds.api.mi-img.com/mi.com-assets/shop/img/logo-mi2.png" alt=""
                        style="width: 40px;height: 40px;">
                </div>
                <div class="navbar_two">
                    <h1>小米账号</h1>
                </div>
            </div>
            <div class="content_tabs">
                <!-- <AllinTabs @TabsChange="handleChange"></AllinTabs> -->
                <div class="_tabs">
                    <p v-for="(data, index) in list" :key="data" @click="handle(index)"
                        :class="isShow == index ? 'active' : ''">{{
                        data
                        }}
                    </p>
                </div>


                <el-tooltip class="box-item" effect="light" content="扫码登录" placement="left">
                    <el-button class="two_dimensional">
                        <i class="iconfont icon-erweima"></i>
                    </el-button>
                </el-tooltip>


                <div>
                    <Allin_login v-if="isShow == 0"></Allin_login>
                    <Allin_register v-if="isShow == 1"></Allin_register>
                </div>
            </div>
        </div>

    </div>
</template>

<script setup>
import { ref } from 'vue'
import Allin_login from '../components/Allin_component/Allin_login.vue';
import Allin_register from '../components/Allin_component/Allin_register.vue';
import AllinTabs from '../components/Allin_component/AllinTabs.vue'
import Hidden from '../utils/hidden'
import { useRouter, useRoute } from 'vue-router';
// 隐藏导航栏
Hidden()

const list = ref(["登录", "注册"])
const router = useRouter()
const route = useRoute()

const isShow = ref(0)

if (route.params.myid === 'login') {
    isShow.value = 0
} else if (route.params.myid === 'register') {
    isShow.value = 1
}

const handle = (index) => {
   isShow.value=index
}
</script>
<style lang="scss" scoped>
* {
    margin: 0;
    padding: 0;
}

.active {
    border-bottom: 4px solid #ff5c00;
    color: black !important;
}

._tabs {
    width: 120px;
    height: 60px;
    display: flex;
    justify-content: space-between;
    position: relative;

    p {
        width: 50px;
        height: 35px;
        font-size: 25px;
        font-weight: 600;
        color: #ccc;
        text-align: center;
        cursor: pointer;
    }

}
.register_content {
    width: 100vw;
    height: 100vh;

    display: flex;
    box-sizing: border-box;
    overflow: hidden;

    .content_img {
        flex: 0.5;

    }

    .content_form {
        flex: 1.5;
        display: flex;
        justify-content: center;
        background: #ffffff;
        position: relative;

        .content_tabs {
            width: 450px;
            height: 550px;
            padding: 40px 45px;
            box-sizing: border-box;
            background: white;
            box-shadow: 1px -2px 6px #ccc;
            margin-top: 100px;
            border-radius: 10px;
            position: relative;

            .two_dimensional {
                position: absolute;
                top: 0;
                right: 0;
                width: 64px;
                height: 64px;
                background: #ffbe99;
                border-radius: 0 10px 0 0;
                display: flex;
                justify-content: center;
                align-items: center;
                cursor: pointer;
                border: none;

                i {
                    display: block;
                    font-size: 60px;
                    color: white;
                }
            }

            .two_dimensional:hover {
                background: orangered;
            }

            .two_dimensional::before {
                content: "";
                border: 32px solid white;
                position: absolute;
                border-top-color: transparent;
                border-right-color: transparent;
                left: 0px;
            }
        }

        .content_navbar {
            position: absolute;
            left: 0;
            top: 0;
            display: flex;
            width: 100%;
            height: 80px;

            .navbar_one {
                width: 80px;
                height: 80px;
                display: flex;
                justify-content: center;
                align-items: center;
            }

            .navbar_two {
                width: 200px;
                height: 80px;

                h1 {
                    line-height: 80px;
                }
            }
        }
    }
}
</style>